<%@page import="com.google.appengine.api.images.ImagesServiceFactory"%>
<%@page import="com.google.appengine.api.blobstore.BlobstoreServiceFactory"%>
<%@page import="com.google.appengine.api.images.ImagesService"%>
<%@page import="com.google.appengine.api.blobstore.BlobstoreService"%>
<%@page import="com.google.appengine.api.blobstore.BlobKey"%>
<%@page import="entities.Domain"%>
<%
	Domain domain = (Domain) request.getAttribute("domain");
	/* ImagesService imagesService = null;
	BlobKey blobKey = null;
	if (!domain.getWaterfallThumb().isEmpty()) {
		blobKey = new BlobKey(domain.getWaterfallThumb());
		BlobstoreService blobStoreService = BlobstoreServiceFactory.getBlobstoreService();
		imagesService = ImagesServiceFactory.getImagesService();
	} */
%>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/layouts/header.jsp" />
	<script type="text/javascript" src="/js/pagetest.js"></script>
	
	<h1>Web Page Performance Test for <a href="/out/<%=domain.getDomain()%>"><%=domain.getDomain() %></a></h1>
	
	<ul id="tabs">
	    <li><a href="/" name="#tab1">Recent Domain View</a></li>
	    <li><a href="#" name="#tab2">Content Breakdown</a></li>
	</ul>

	<div id="content">
	    <div id="tab1">
	    	
	    	
	    </div>
	    <div id="tab2">
	        <!--Load the AJAX API-->
		    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
		    <script type="text/javascript">
			<%=domain.getContentBreakdown() %>
			</script>
			
			<div class="adv">
				<script type="text/javascript"><!--
				google_ad_client = "ca-pub-1271973886625217";
				/* domainworlds 2 (468x15) */
				google_ad_slot = "5646270918";
				google_ad_width = 468;
				google_ad_height = 15;
				//-->
				</script>
				<script type="text/javascript"
				src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
				</script>
			</div>
			<br />
			
			<%=domain.getTableResult() %>
			<hr />
			<br />
			<div class="adv" align="center">
		    	<script type="text/javascript"><!--
				google_ad_client = "ca-pub-1271973886625217";
				/* domainworlds 728x90 */
				google_ad_slot = "0571679791";
				google_ad_width = 728;
				google_ad_height = 90;
				//-->
				</script>
				<script type="text/javascript"
				src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
				</script>
		    </div>
		    <br />
			
			<table align="center">
		        <tr>
		            <th colspan="2">
			            <h2>Content breakdown by MIME type (First  View)</h2>
			            <div class="adv">
							<script type="text/javascript"><!--
							google_ad_client = "ca-pub-1271973886625217";
							/* domainworlds 2 (468x15) */
							google_ad_slot = "5646270918";
							google_ad_width = 468;
							google_ad_height = 15;
							//-->
							</script>
							<script type="text/javascript"
							src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
							</script>
						</div>
						<br />
		            </th>
		        </tr>
		        <tr>
		            <td>
		                <div id="pieRequestsFv_div" style="width:450px; height:300px;"></div>
		            </td>
		            <td>
		                <div id="pieBytesFv_div" style="width:450px; height:300px;"></div>
		            </td>
		        </tr>
		        <tr>
		            <td>
		                <div id="tableRequestsFv_div" style="width: 100%;"></div>
		            </td>
		            <td>
		                <div id="tableBytesFv_div" style="width: 100%;"></div>
		            </td>
		        </tr>
		    </table>
		    
		    <br />
			<div class="adv" align="center">
		    	<script type="text/javascript"><!--
				google_ad_client = "ca-pub-1271973886625217";
				/* domainworlds 728x90 */
				google_ad_slot = "0571679791";
				google_ad_width = 728;
				google_ad_height = 90;
				//-->
				</script>
				<script type="text/javascript"
				src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
				</script>
		    </div>
		    <br />
		    
		    <hr />
		    <table align="center">
		        <tr>
		            <th colspan="2">
		            	<h2>Content breakdown by MIME type (Repeat  View)</h2>
		            	<div class="adv">
							<script type="text/javascript"><!--
							google_ad_client = "ca-pub-1271973886625217";
							/* domainworlds 2 (468x15) */
							google_ad_slot = "5646270918";
							google_ad_width = 468;
							google_ad_height = 15;
							//-->
							</script>
							<script type="text/javascript"
							src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
							</script>
						</div>
						<br />
		            </th>
		        </tr>
		        <tr>
		            <td>
		                <div id="pieRequestsRv_div" style="width:450px; height:300px;"></div>
		            </td>
		            <td>
		                <div id="pieBytesRv_div" style="width:450px; height:300px;"></div>
		            </td>
		        </tr>
		        <tr>
		            <td>
		                <div id="tableRequestsRv_div" style="width: 100%;"></div>
		            </td>
		            <td>
		                <div id="tableBytesRv_div" style="width: 100%;"></div>
		            </td>
		        </tr>
		    </table>
			
			<hr />
			
	    </div>
	</div>
<jsp:include page="/layouts/footer.jsp" />